import java.util.Scanner;

public class Demo0504 {
    public static int add(int x, int y) {
        return x + y;
    }

    public static double add(double x, double y, double z) {
        return x + y + z;
    }

    public static int func1(int n) {
        int sum=0;
        for (int i=1; i<=n; i++) {
            int sum1=1;
           for(int j=1;j<=i;j++){
               sum1*=j;
           }
           sum+=sum1;
        }
        return sum;
}
    public static int max(int x, int y) {
        return x>y?x:y;
    }
//    写一个递归方法，输入一个非负整数，返回组成它的数字之和
    public static int sum(int x) {

    if(x<=9) {
        return x;
    }else{
        return x%10+sum(x/10);
    }
}
    //    递归打印数字的每一位
    public static void printeveryplace(int x) {

        if(x<=9) {
            System.out.println(x);
        }else{
            printeveryplace(x/10);
            System.out.println(x%10);
        }
    }
//    递归求斐波那契数列的第 N 项
    public static int Fibonacci(int n) {

    if(n<=2) {
        return 1;
    }else{
        return Fibonacci(n-1)+Fibonacci(n-2);
    }
}
//    递归求 1 + 2 + 3 + ... + 10
  public static int sum2(int x) {

    if(x==1) {
        return 1;
    }else{
        return x+sum2(x-1);
    }
}
//    递归求 N 的阶乘
    public static int myfactorial(int n ) {
        if(n<=1) {
            return 1;
        }else{
            return n*myfactorial(n-1);
        }
    }
//    求斐波那契数列的第n项。(迭代实现)
    public static void main1(String[] args) {
        int f1=1;
        int f2=1;
        int f3=0;
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        if(n<=2) {
            System.out.println(1);
        }else{

            for (int i = 2; i < n; i++) {
                f3 = f1 + f2;
                int tmp = f2;
                f2 = f3;
                f1 = tmp;
            }
            System.out.println(f3);
        }
}
    public static double max(double x, double y) {
        return x>y?x:y;
    }
    public static int func2(int n) {
        int sum=1;
        for(int i=1;i<=n;i++){
            sum*=i;
        }
        return sum;
    }
    public static void max( double x, double y,int z) {
        double tmp= x>y?x:y;
      if(z>tmp)  System.out.println("整数大");
      else System.out.println("小数大");
    }
    public static void main(String[] args) {
        System.out.println(myfactorial(6));
    }
}
